<?php

namespace App\Service\Activity;

use App\Model\Act\UserRankAct;
use App\Model\UserProfile;
use App\Service\BaseService;

/**
 * 声优贤惠活动信息
 */
class HostRewardInfoService extends BaseService
{
    public function handle()
    {
        $userId = $this->request->input('uid', 0);
        $userProfile = UserProfile::getProfile($userId);
        if (!$userProfile) return [];
        $rankInfo = UserRankAct::getUserRank($userId);
        return [
            'user_id' => $userProfile->user_id,
            //当前排名
            'avatar' => $userProfile->avatar,
            //当前排名
            'rank' => $rankInfo['rank'],
            //当前分数
            'rank_value' => $rankInfo['rank_value'],
            //上榜还差分数
            'left_value' => $rankInfo['left_value'],
        ];
    }
}
